<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Score extends Model
{
    protected $dates = ['test_date'];

    public function student()
    {
        return $this->belongsTo(Student::class);
    }

    public function subject()
    {
        return $this->belongsTo(Subject::class);
    }

    public function getTestDateAttribute($value)
    {
        return date('Y-m-d H:i:s', strtotime($value));
    }
}
